const TODOS_KEY = 'todos'
export default {
  saveTodos (todos) {
    window.localStorage.setItem(TODOS_KEY, JSON.stringify(todos))
  },
  readTodos () {
    return JSON.parse(window.localStorage.getItem(TODOS_KEY) || '[]')
  },
  get (name) {
    return window.localStorage.getItem(name) || ''
  },
  set (name, val) {
    window.localStorage.setItem(name, val)
  }
}
